import request from '@/utils/request'
 
// 提交问题反馈
export const saveFeedback = (formData: { contact: string; description: string }) => {
  return request({
    url: '/feedback/save',
    method: 'POST',
    data: {
      submitContacts: formData.contact,    // 联系方式
      submitContent: formData.description  // 反馈内容
    }
  })
}

// 提交用户信息
export const saveUserInfo = (formData: { nickname: string; birthday: string; gender: number | null }) => {
  return request({
    url: '/user/saveUserInfo',
    method: 'POST',
    data: {
      nickname: formData.nickname,
      birthday: formData.birthday,
      gender: formData.gender
    }
  })
}

// 获取用户信息
export const getUserInfo = () => {
  return request({
    url: '/user/info',
    method: 'POST',
  })
}

// 退出登录
export const wechatLogout = () => {
  return request({
    url: '/auth/wechatLogout',
    method: 'POST',
  })
}

// 获取隐私协议
export const getPrivacy = () => {
  return request({
    url: '/openApi/getPrivacy',
    method: 'GET',
  })
}